<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../css/mobiscroll-3.0.0.min.css"/>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/mobiscroll-3.0.0.min.js"></script>
    <style>
        .mbsc-android-holo .dwv {
            text-align: left;
            text-indent: .8em;
        }
    </style>
</head>
<body>
<from>
    年级<input type="text" id="grade">
</from>
<ul id="treelist">
    <li date-value="普通班">普通班</li>
    <li>VIP班</li>
    <li>特色班</li>
    <li>至尊班</li>
    <li>女子特训班</li>
</ul>
</body>
<script>
//    $(function () {
//        $("#treelist").mobiscroll().treelist({
//            theme: "material",
//            lang: "zh",
//            defaultValue: [Math.floor($('#treelist li').length / 2)],
//            cancelText: null,
//            headerText: function (valueText) {
//                return "选择班级";
//            },
//
//        });
//    })

   $('#grade').on('click',function () {
       $("#treelist").mobiscroll().treelist({
           theme: "material",
           lang: "zh",
           defaultValue: [Math.floor($('#treelist li').length / 2)],
           cancelText: null,
           headerText: function (valueText) {
               return "选择班级";
           },
       })

   });
</script>
</html>
